<%-- 
    Document   : cadastroEvento
    Created on : 17/09/2014, 22:17:09
    Author     : luiz
--%>

<%@page import="java.util.Random"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="entidade.Usuario"%>
<%@page import="dao.AvisoDAO"%>
<%@page import="entidade.Aviso"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="../css/foundation/foundation.css" rel="stylesheet" type="text/css"/>
        <script src="../js/foundation.min.js" type="text/javascript"></script>
        <script src="../js/javascript.js" type="text/javascript"></script>
        <script src="../js/jquery-1.11.1.min.js" type="text/javascript"></script>
        <script src="../js/foundation/foundation.js" type="text/javascript"></script>
        <link rel="stylesheet" type="text/css" href="css/style.css">
        <link rel="stylesheet" type="text/css" href="css/foundation/foundation.min.css">
        <link rel="stylesheet" type="text/css" href="css/foundation/normalize.css">
        <script src="js/prefixfree-1.0.7.js"></script>
        <script src="js/jquery-1.11.1.min.js"></script>
        <script src="js/jquery-1.7.1.min.js" ></script>
        <script src="js/foundation.min.js"></script>
        <script src="js/script.js"></script>
    </head>
    <body class="fundo">
        <div class="menu_interno">
            <div class="menu_interno_logo">
                <img src="imagens/logo.png">
            </div>
            <div class="menu_interno_list">
                <div id="accordian">
                    <ul class="ul">
                        <li>
                            <h3><span class="icon-dashboard"></span><a href="">Avisos</a></h3>
                        </li>
                    </ul>
                </div>

            </div>
            <div class="menu_interno_rodape">
                <a href="principal.jsp"><img src="imagens/back.png"></a>
            </div>
        </div>
        <div id="container" class="content">
            <div class="margintop_content">
                <%String[] cores = new String[]
                    {
                        "#FEF1F6", "#E2EDC1", "#DFF3FD", "#ECCCFF", "#FFCCCC", "#D9FFCC"
                    };
                    Usuario u = (Usuario) session.getAttribute("user");
                    Random random = new Random(cores.length);                    
                %>
                <%for (Aviso a : new AvisoDAO().buscarAvisosUsuario(u))
                    {%>
                <div class="teste">
                    <div class="teste-aa" style="background: <%=cores[random.nextInt(cores.length)]%>">
                        <div class="teste-aa2">
                            <h4><strong><%=a.getEvento().getNome()%></strong></h4>
                            <span><strong>Data:</strong><%=new SimpleDateFormat("dd/MM/yyyy").format(a.getDataAviso())%></span><br/>
                            <span><strong>Descrição:</strong><%=a.getDescricao()%></span>
                        </div>
                    </div>                
                </div>
                <%}%>
            </div>
        </div>
        <div class="lateral_esq">
            <img src="imagens/capa3.png">
        </div>
    </body>
</div>
</body>
</html>
